package com.chandra.pos.common.utils;

/* @(#) DateUtils.java
 * Copyright 2013 - 2015 QatarAirways Group. All Rights Reserved.
 *
 * This Software is the proprietary information of QR Group
 * Use is subject to License terms.
 * Created by T4671 on 21/04/2015.
 */

import com.chandra.pos.common.model.POSConstant;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public class DateUtils {



    public static DateTime format(String dateString){
        DateTimeFormatter formatter = DateTimeFormat.forPattern(POSConstant.APP_DATE_FORMAT);
        DateTime dt = formatter.parseDateTime(dateString);

        return dt;

    }

    public static String format(DateTime dateTime){
        String formattedDate = DateTimeFormat.forPattern(POSConstant.APP_DATE_FORMAT).print(dateTime);


        return formattedDate;

    }
}
